


Namespace Ventas
Public Class ComprobanteTipo



 Public Function Combo(ByVal vTodos As Boolean, Optional ByVal vmensaje As String = "Todos") As Entity.Ventas.ComprobanteTipoCol
dim objCol as  New entity.Ventas.ComprobanteTipoCol
dim obj as  New Data.Ventas.ComprobanteTipo
            objCol = obj.Listar("", _
              -1, _
              "", _
              "", _
              -1)
 If vTodos Then
                Dim ent As New Entity.Ventas.ComprobanteTipo( _
                  -1, _
                  vmensaje, _
                  "", _
                  -1)
objCol.AddPrimero(ent)
End If
Return objCol
End Function


'***************************


public Function Listar(ComprobanteTipoId as integer) as Entity.Ventas.ComprobanteTipo

dim objEnt as  New entity.Ventas.ComprobanteTipo
dim obj as  New Data.Ventas.ComprobanteTipo
return obj.Listar(ComprobanteTipoId)

End Function


'***************************



public Function Listar( _
		ComprobanteTipoId as Integer, _
		Nombre as String, _
		Descripcion as String, _
		Estado as Integer) _
as  Entity.Ventas.ComprobanteTipoCol

dim objCol as  New entity.Ventas.ComprobanteTipoCol
dim obj as  New Data.Ventas.ComprobanteTipo
return obj.listar("", _
		ComprobanteTipoId, _
		Nombre, _
		Descripcion, _
		Estado)

End Function


'***************************


public Function Grabar( _
		ComprobanteTipoId as Integer, _
		Nombre as String, _
		Descripcion as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteTipo
 if ComprobanteTipoId=-1 then 
_codigo= obj.insert( "", _
		ComprobanteTipoId , _
		Nombre , _
		Descripcion , _
		Estado , _
 vUSuario )
else
_codigo= obj.update( "", _
		ComprobanteTipoId , _
		Nombre , _
		Descripcion , _
		Estado , _
 vUSuario )
end if 
return _codigo

End Function


'***************************


public Function Insertar( _
		ComprobanteTipoId as Integer, _
		Nombre as String, _
		Descripcion as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteTipo
_codigo= obj.insert( "", _
		ComprobanteTipoId, _
		Nombre, _
		Descripcion, _
		Estado, _
 vUSuario )
return _codigo

End Function


'***************************


public Function Updatear( _
		ComprobanteTipoId as Integer, _
		Nombre as String, _
		Descripcion as String, _
		Estado as Integer, _
vUSuario as integer)as  integer

dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteTipo
_codigo= obj.Update( "", _
		ComprobanteTipoId , _
		Nombre , _
		Descripcion , _
		Estado , _
 vUSuario )
return _codigo

End Function


'***************************


public Function ELiminar(  ComprobanteTipoId as integer,vusuario as integer ,optional vopcion as string="Delete") as integer
dim _codigo as integer =-1
dim obj as  New Data.Ventas.ComprobanteTipo
_codigo= obj.Eliminar( "vopcion", ComprobanteTipoId ,vusuario)
return _codigo

End Function

End Class



end namespace

